<script>
import { defineComponent } from "vue";
import {pageHandler} from '@/mixins/pageHandler'
import RightClickmenuList from "@/components/rightClickmenuList/rightClickMenuList.vue";
import YaokongDialog from "@/components/rightClickmenuList/yaokongDialog.vue";
import GuapaiDialog from "@/components/rightClickmenuList/guapaiDialog.vue";
import ScaleBox from "@/components/ScaleBox/ScaleBox.vue";
import MonitorHeader from "@/components/MonitorHeader/MonitorHeader.vue";
import NetState from "@/components/controls/netState.vue";
import ConnectLine from "@/components/controls/connect-line.vue";
import TerminalSvg from "@/components/controls/terminal-svg.vue";
import RectSvg from "@/components/controls/rect-svg.vue";
import ShouCheSvg from "@/components/controls/shou-che-svg.vue";
import { submitOperateRecord } from "@/api/api";
import { wsSend } from "@/tools/sendMessage";
import KongZhiBaShou from "@/components/controls/KongZhiBaShou.vue";
import YingYaBan from "@/components/controls/YingYaBan.vue";
import GuangZiPai from "@/components/controls/GuangZiPai.vue";
import Zhanyongbian from "@/components/controls/zhanyongbian.vue";
import Dianrongqi from "@/components/controls/dianrongqi.vue";
import Diankangqi from "@/components/controls/dianKangQi.vue";

export default defineComponent({
  name: "zhubian",
  components: {
      Diankangqi,
      Dianrongqi,
      Zhanyongbian,
      GuangZiPai, YingYaBan, KongZhiBaShou, ShouCheSvg, RectSvg, TerminalSvg, ConnectLine, NetState, MonitorHeader, ScaleBox, GuapaiDialog, YaokongDialog, RightClickmenuList },
  mixins: [pageHandler],
  data() {
    return {
      hardPlatenDataList: [],
      flexiblePlatenDataList: [],
      GZPDataList: [],
      netStateList: [],
      numList:[],
      bashouList:[],
      svgYaban:[],
    };
  },
  methods:{
    initData(e){
      const typeMap = {
        "压板": "hardPlatenDataList",
        "网络状态": "netStateList",
        "遥测":'numList',
        "把手":"bashouList",
          "光字牌":'GZPDataList'
      };

      for (const listName of Object.values(typeMap)) {
        this[listName] = [];
      }
      for (const [key, value] of Object.entries(e)) {
        for (const [type, listName] of Object.entries(typeMap)) {
          const filtered = value.filter(item => item.type === type);
          if (filtered.length > 0) {
            this[listName].push({ name: key, list: filtered });
          }
        }
      }
        console.log(this.netStateList)
    },
    dangwei(val) {
      wsSend({
        "cmd": "byqDwChange",
        "dataId":this.pageData['重要遥测'][3].data_id,
        "operate":val,
      });
      submitOperateRecord( {
        log_desc:`${this.$route.query.ftName}${val==='up'?'升':val==='down'?'降':'停'}档操作`
      })
    },
  }
});
</script>

<template>
  <div class="breaker-graph" @click="cancelLeftClickMenu" @contextmenu.stop="cancelLeftClickMenu" v-if="pageData">
    <scale-box :width="2320">
      <MonitorHeader :title="$route.query.ftName" >
        <template v-slot:btns>
          <button @click="routerToMainPage">主接线图</button>
          <button @click="clearAll($route.query.ftName)">画面清闪</button>
          <button @click="operationRecords">操作记录</button>
        </template>
      </MonitorHeader>
      <main>
<div>
    <div class="line-wrapper">
        <svg>
            <g>
                <g transform="translate(650,350)">
                    <g v-for="(item,index) in pageData['遥测']">
                        <text stroke="#fff" fill="#fff" x="0" :y="index*30">{{item.state_desc}}</text>
                        <text x="100" :y="index*30"  stroke="rgb(143, 243, 86)" fill="rgb(143, 243, 86)">{{Number(item.state_val)}}</text>
                    </g>

                </g>
                <line x1="150" y1="0" x2="300" y2="0" stroke="rgb(128,0,128)" stroke-width="5"></line>
                <text x="50" y="5" fill="#FFFFFF" font-size="16px">220kV 1A母</text>
                <text x="50" y="25" fill="#FFFFFF" font-size="16px">220kV 2A母</text>
                <line x1="150" y1="20" x2="300" y2="20" stroke="rgb(128,0,128)" stroke-width="5"></line>
                <line x1="225" y1="0" x2="225" y2="40" stroke="rgb(128,0,128)" stroke-width="2"></line>
                <line x1="275" y1="20" x2="275" y2="40" stroke="rgb(128,0,128)" stroke-width="2"></line>
                <connect-line
                        :state="Number(pageData['glg'][0].state_val)"
                        :stateDesc="pageData['glg'][0].state_desc"
                        :name="'-'+pageData['glg'][0].state_desc.split('-')[1]"
                        :scale=0.7
                        :info="pageData['glg'][0]"
                        :translate-x="253"
                        :translate-y="42"
                        :text-translate-y="-5"
                        :rotate="90"
                        @itemRightClick="itemRightClick"
                />
                <connect-line
                        :state="Number(pageData['glg'][1].state_val)"
                        :stateDesc="pageData['glg'][1].state_desc"
                        :name="'-'+pageData['glg'][1].state_desc.split('-')[1]"
                        :scale=0.7
                        :info="pageData['glg'][1]"
                        :translate-x="303"
                        :translate-y="42"
                        :text-translate-y="-5"
                        :rotate="90"
                        :text-translate-x="2"
                        @itemRightClick="itemRightClick"
                />
                <polyline points="275,74,275,94,225,94,175,94,175,74" stroke="rgb(128,0,128)" stroke-width="2" fill="none"></polyline>
                <terminal-svg
                        :state="Number(pageData['dd'][0].state_val)"
                        :stateDesc="pageData['dd'][0].state_desc"
                        :name="'-'+pageData['dd'][0].state_desc.split('-')[1]"
                        :scale=0.7
                        :info="pageData['dd'][0]"
                        :translate-x="158"
                        :translate-y="27"
                        :text-translate-y="25"
                        :text-translate-x="-30"
                        :rotate="0"
                        @itemRightClick="itemRightClick"
                />
                <line x1="225" y1="74" x2="225" y2="184" stroke="rgb(128,0,128)" stroke-width="2"></line>
                <rect-svg
                        :state="Number(pageData['dlq'][0].state_val)"
                        :stateDesc="pageData['dlq'][0].state_desc"
                        :rotate="90"
                        :translate-y="110"
                        :translate-x="261"
                        :text-translate-x="-2"
                        :text-translate-y="0"
                        :scale="0.9"
                        :info="pageData.dlq[0]"
                        @itemRightClick="itemRightClick"
                        :itemObj="{is_clear:pageData['dlq'][0].is_clear}"
                        :name="pageData['dlq'][0].state_desc"
                ></rect-svg>
                <polyline points="225,164,275,164,275,184" stroke="rgb(128,0,128)" stroke-width="2" fill="none"></polyline>
                <connect-line
                        :state="Number(pageData['glg'][2].state_val)"
                        :stateDesc="pageData['glg'][2].state_desc"
                        :name="'-'+pageData['glg'][2].state_desc.split('-')[1]"
                        :scale=0.7
                        :info="pageData['glg'][2]"
                        :translate-x="253"
                        :translate-y="188"
                        :text-translate-y="-5"
                        :rotate="90"
                        :text-translate-x="2"
                        @itemRightClick="itemRightClick"
                />
                <terminal-svg
                        :state="Number(pageData['dd'][1].state_val)"
                        :stateDesc="pageData['dd'][1].state_desc"
                        :name="'-'+pageData['dd'][1].state_desc.split('-')[1]"
                        :scale=0.7
                        :info="pageData['dd'][1]"
                        :translate-x="292"
                        :translate-y="231"
                        :text-translate-y="15"
                        :text-translate-x="80"
                        :rotate="180"
                        @itemRightClick="itemRightClick"
                />
                <terminal-svg
                        :state="Number(pageData['dd'][2].state_val)"
                        :stateDesc="pageData['dd'][2].state_desc"
                        :name="'-'+pageData['dd'][2].state_desc.split('-')[1]"
                        :scale=0.7
                        :info="pageData['dd'][2]"
                        :translate-x="157"
                        :translate-y="173"
                        :text-translate-y="25"
                        :text-translate-x="-40"
                        :rotate="0"
                        @itemRightClick="itemRightClick"
                />
                <polyline points="225,240,175,240,175,220" stroke="rgb(128,0,128)" stroke-width="2" fill="none"></polyline>
                <polyline points="225,220,225,260,350,260" stroke="rgb(128,0,128)" stroke-width="2" fill="none"></polyline>
                <zhanyongbian
                        color="rgb(128,0,128)"
                        color_1="rgb(255,255,0)"
                        :rotate="-180"
                        :zyb-style="3"
                        :scale="1"
                        :translate-y="-520"
                        :translate-x="-720"
                ></zhanyongbian>

                <line x1="360" y1="260" x2="450" y2="260" stroke="rgb(255,255,0)" stroke-width="2"></line>
                <line x1="450" y1="260" x2="450" y2="270" stroke="rgb(255,255,0)" stroke-width="2"></line>
                <line x1="410" y1="260" x2="410" y2="280" stroke="rgb(255,255,0)" stroke-width="2"></line>
                <diankangqi
                        color="rgb(255,0,0)"
                        :scale="0.5"
                        :translate-y="11"
                        :translate-x="292"
                        :swidth="4"
                        :rotate="180"
                ></diankangqi>
                <terminal-svg
                        :state="Number(pageData['dd'][5].state_val)"
                        :stateDesc="pageData['dd'][5].state_desc"
                        :name="pageData['dd'][5].state_desc"
                        :scale=0.7
                        :info="pageData['dd'][5]"
                        :translate-x="466"
                        :translate-y="317"
                        :text-translate-y="15"
                        :text-translate-x="81"
                        :rotate="180"
                        @itemRightClick="itemRightClick"
                />
                <g transform="translate(135,170)">
                    <line x1="225" y1="134" x2="225" y2="184" stroke="rgb(255,255,0)" stroke-width="2"></line>
                    <polyline points="225,164,275,164,275,184" stroke="rgb(255,255,0)" stroke-width="2" fill="none"></polyline>
                    <connect-line
                            :state="Number(pageData['glg'][4].state_val)"
                            :stateDesc="pageData['glg'][4].state_desc"
                            :name="'-'+pageData['glg'][4].state_desc.split('-')[1]"
                            :scale=0.7
                            :info="pageData['glg'][4]"
                            :translate-x="253"
                            :translate-y="188"
                            :text-translate-y="-5"
                            :rotate="90"
                            :text-translate-x="2"
                            @itemRightClick="itemRightClick"
                    />
                    <terminal-svg
                            :state="Number(pageData['dd'][6].state_val)"
                            :stateDesc="pageData['dd'][6].state_desc"
                            :name="'-'+pageData['dd'][6].state_desc.split('-')[1]"
                            :scale=0.7
                            :info="pageData['dd'][6]"
                            :translate-x="292"
                            :translate-y="231"
                            :text-translate-y="15"
                            :text-translate-x="80"
                            :rotate="180"
                            @itemRightClick="itemRightClick"
                    />
                    <terminal-svg
                            :state="Number(pageData['dd'][7].state_val)"
                            :stateDesc="pageData['dd'][7].state_desc"
                            :name="'-'+pageData['dd'][7].state_desc.split('-')[1]"
                            :scale=0.7
                            :info="pageData['dd'][7]"
                            :translate-x="157"
                            :translate-y="173"
                            :text-translate-y="25"
                            :text-translate-x="-40"
                            :rotate="0"
                            @itemRightClick="itemRightClick"
                    />
                    <polyline points="225,240,175,240,175,220" stroke="rgb(255,255,0)" stroke-width="2" fill="none"></polyline>
                    <polyline points="225,220,225,350" stroke="rgb(255,255,0)" stroke-width="2" fill="none"></polyline>
                    <rect-svg
                            :state="Number(pageData['dlq'][2].state_val)"
                            :stateDesc="pageData['dlq'][2].state_desc"
                            :rotate="90"
                            :translate-y="260"
                            :translate-x="261"
                            :text-translate-x="-2"
                            :text-translate-y="0"
                            :scale="0.9"
                            :info="pageData.dlq[2]"
                            @itemRightClick="itemRightClick"
                            :itemObj="{is_clear:pageData['dlq'][1].is_clear}"
                            :name="pageData['dlq'][2].state_desc"
                    ></rect-svg>
                    <line x1="150" y1="350" x2="300" y2="350" stroke="rgb(255,255,0)" stroke-width="5"></line>
                    <text x="60" y="355" fill="#FFFFFF" font-size="16px">35kV I母</text>
                </g>
                <g transform="translate(500,20)">
                    <line x1="150" y1="0" x2="300" y2="0" stroke="rgb(250,0,0)" stroke-width="5"></line>
                    <text x="50" y="5" fill="#FFFFFF" font-size="16px">500kV I母</text>
                    <line x1="185" y1="0" x2="185" y2="20" stroke="rgb(250,0,0)" stroke-width="2"></line>
                    <connect-line
                            :state="Number(pageData['glg'][3].state_val)"
                            :stateDesc="pageData['glg'][3].state_desc"
                            :name="pageData['glg'][3].state_desc"
                            :scale=0.7
                            :info="pageData['glg'][3]"
                            :translate-x="213"
                            :translate-y="22"
                            :text-translate-y="-5"
                            :text-translate-x="-70"
                            :rotate="90"
                            @itemRightClick="itemRightClick"
                    />
                    <polyline points="185,54,185,190,-140,190,-140,212" stroke="rgb(250,0,0)" stroke-width="2" fill="none"></polyline>
                    <polyline points="185,74,235,74,235,64" stroke="rgb(250,0,0)" stroke-width="2" fill="none"></polyline>
                    <polyline points="185,74,235,74,235,64" stroke="rgb(250,0,0)" stroke-width="2" fill="none" transform="translate(0,100)"></polyline>
                    <rect-svg
                            :state="Number(pageData['dlq'][1].state_val)"
                            :stateDesc="pageData['dlq'][1].state_desc"
                            :rotate="90"
                            :translate-y="110"
                            :translate-x="221"
                            :text-translate-x="-60"
                            :text-translate-y="0"
                            :scale="0.9"
                            :info="pageData.dlq[1]"
                            @itemRightClick="itemRightClick"
                            :itemObj="{is_clear:pageData['dlq'][1].is_clear}"
                            :name="pageData['dlq'][1].state_desc"
                    ></rect-svg>
                    <terminal-svg
                            :state="Number(pageData['dd'][3].state_val)"
                            :stateDesc="pageData['dd'][3].state_desc"
                            :name="pageData['dd'][3].state_desc"
                            :scale=0.7
                            :info="pageData['dd'][3]"
                            :translate-x="216"
                            :translate-y="15"
                            :text-translate-y="25"
                            :text-translate-x="40"
                            :rotate="0"
                            @itemRightClick="itemRightClick"
                    />
                    <terminal-svg
                            :state="Number(pageData['dd'][4].state_val)"
                            :stateDesc="pageData['dd'][4].state_desc"
                            :name="pageData['dd'][4].state_desc"
                            :scale=0.7
                            :info="pageData['dd'][4]"
                            :translate-x="216"
                            :translate-y="117"
                            :text-translate-y="25"
                            :text-translate-x="40"
                            :rotate="0"
                            @itemRightClick="itemRightClick"
                    />
                </g>

            </g>
        </svg>
    </div>
    <div class="num-wrapper">
        <div class="remote-measurement-wrapper">
            <div class="remote-measurement-table">
                <table border="3" cellspacing="0">
                    <colgroup>
                        <col style="width: 18%;" />
                        <col style="width: 18%;" />
                        <col style="width: 18%;" />
                        <col style="width: 18%;" />
                        <col style="width: 18%;" />
                        <col style="width: 10%;" />
                    </colgroup>
                    <tbody>
                    <tr style="background-color: rgb(35,130,222)">
                        <td></td>
                        <td>{{numList[0].name}}</td>
                        <td>{{numList[1].name}}</td>
                        <td>{{numList[2].name}}</td>
                        <td>{{numList[3].name}}</td>
                        <td>单位</td>
                    </tr>
                    <tr v-for="(item, index) in numList[0].list" :key="index"   :style="{ backgroundColor: index % 2 === 0 ? 'rgb(36, 104, 176)' : 'rgb(35, 130, 222)' }">
                        <td :style="{color: 'white'}">{{item.state_desc}}</td>
                        <td style="color: #3CFF1E;cursor: pointer;" @contextmenu.prevent.stop="checkVal(item,true)">{{Number(item.state_val).toFixed(2)}}</td>
                        <td style="color: #3CFF1E;cursor: pointer;" @contextmenu.prevent.stop="checkVal(numList[1].list[index],true)">{{Number(numList[1].list[index].state_val).toFixed(2)}}</td>
                        <td style="color: #3CFF1E;cursor: pointer;" @contextmenu.prevent.stop="checkVal(numList[2].list[index],true)">{{Number(numList[2].list[index].state_val).toFixed(2)}}</td>
                        <td style="color: #3CFF1E;cursor: pointer;" @contextmenu.prevent.stop="checkVal(numList[3].list[index],true)">{{Number(numList[3].list[index].state_val).toFixed(2)}}</td>
                        <td :style="{color: 'white'}">{{item.unit}}</td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
        <div class="remote-measurement-wrapper">
            <div class="remote-measurement-table">
                <table border="3" cellspacing="0">
                    <colgroup>
                        <col style="width: 40%;" />
                        <col style="width: 40%;" />
                        <col style="width: 20%;" />
                    </colgroup>
                    <tbody>
                    <tr style="background-color: rgb(35,130,222)">
                        <td></td>
                        <td>{{numList[4].name}}</td>
                        <td>单位</td>
                    </tr>
                    <tr v-for="(item, index) in numList[4].list" :key="index"   :style="{ backgroundColor: index % 2 === 0 ? 'rgb(36, 104, 176)' : 'rgb(35, 130, 222)' }">
                        <td :style="{color: 'white'}">{{item.state_desc}}</td>
                        <td style="color: #3CFF1E;cursor: pointer;" @contextmenu.prevent.stop="checkVal(item,true)">{{Number(item.state_val).toFixed(2)}}</td>
                        <td :style="{color: 'white'}">{{item.unit}}</td>
                    </tr>
                    </tbody>
                </table>
            </div>
        </div>
    </div>
</div>
<div>
    <div class="control-handle-wrapper">
        <div style="font-size: 1.6rem;text-align: center;margin-bottom: 1rem">{{bashouList[0].name}}</div>
        <div class="control-handle-grid">
            <div v-for="(item, index) in bashouList[0].list" :key="index" class="control-handle-grid-item">
                <template v-if="item.isEmpty"></template>
                <template v-else>
                    <div class="svg-wrapper">
                        <svg>
                            <g v-if="item.state_desc.includes('解锁')">
                                <text x="20" y="15" fill="#FFFFFF" font-size="12px">联锁</text>
                                <text x="60" y="60" fill="#FFFFFF" font-size="12px">解锁</text>
                            </g>
                            <g v-else>
                                <text x="20" y="15" fill="#FFFFFF" font-size="12px">远方</text>
                                <text x="60" y="60" fill="#FFFFFF" font-size="12px">就地</text>
                            </g>
                        </svg>
                        <div class="polygon-icon">
                            <div  class="cursor-pointer" style="cursor: pointer">
                                <KongZhiBaShou style="margin-top: -10px" :info=" bashouList[0].list[index]" :name="item.state_desc" :state="Number(item.state_val)"  @itemRightClick="itemRightClick" :deviceName="item.state_desc"  :jianGeMing="item.jg_name"></KongZhiBaShou>
                            </div>
                        </div>
                    </div>
                    <div class="grid-item-name">{{item.state_desc}}</div>
                </template>
            </div>
        </div>
    </div>
    <div class="control-handle-wrapper">
        <div style="font-size: 1.6rem;text-align: center;margin-bottom: 1rem">{{bashouList[1].name}}</div>
        <div class="control-handle-grid" style="  grid-template-columns: repeat(3, 1fr);">
            <div v-for="(item, index) in bashouList[1].list" :key="index" class="control-handle-grid-item">
                <template v-if="item.isEmpty"></template>
                <template v-else>
                    <div class="svg-wrapper">
                        <svg>
                            <g v-if="item.state_desc.includes('解锁')">
                                <text x="20" y="15" fill="#FFFFFF" font-size="12px">联锁</text>
                                <text x="60" y="60" fill="#FFFFFF" font-size="12px">解锁</text>
                            </g>
                            <g v-else>
                                <text x="20" y="15" fill="#FFFFFF" font-size="12px">远方</text>
                                <text x="60" y="60" fill="#FFFFFF" font-size="12px">就地</text>
                            </g>
                        </svg>
                        <div class="polygon-icon">
                            <div  class="cursor-pointer" style="cursor: pointer">
                                <KongZhiBaShou style="margin-top: -10px" :info=" bashouList[1].list[index]" :name="item.state_desc" :state="Number(item.state_val)"  @itemRightClick="itemRightClick" :deviceName="item.state_desc"  :jianGeMing="item.jg_name"></KongZhiBaShou>
                            </div>
                        </div>
                    </div>
                    <div class="grid-item-name">{{item.state_desc}}</div>
                </template>
            </div>
        </div>
    </div>
</div>
<div>
    <div class="netState" >
        <div style="font-size: 1.6rem;text-align: center;margin-bottom: 1rem">{{$route.query.ftName}}测控装置监视</div>
        <div style="display: flex ;justify-content: space-between">
            <div  v-for="item in this.netStateList" style="width: 18%;border: 1px solid #fff;border-radius: 10px;background-color:rgb(40, 71, 106);">
                <div style="text-align: center;font-size: 1.2rem;">{{item.name}}</div>
                <div style="display: flex;" v-for="items in item.list" >
                    <div style="width: 100%;text-align: center">{{items.state_desc}}</div>
                    <net-state :info="items" :state="items.state_val" ></net-state>
                </div>

            </div>
        </div>

    </div>
    <div class="gzp-wrapper">
        <div style="font-size: 1.6rem;text-align: center;margin-bottom: 1rem">{{$route.query.ftName}}信息光字牌</div>
            <div class="gzpInner">
                <div v-for="o in GZPDataList" class="gzpItem">
                    <div class="gzpTitle">{{o.name}}</div>
                    <div v-for="item in o.list">
                        <GuangZiPai :set-hei="true" height="25" :info="item" :isClear="+item.is_clear" :jianGeMing="pageData.glg[1].jg_name" :name="item.state_desc" :state="Number(item.state_val)"></GuangZiPai>
                    </div>
                </div>
            </div>

    </div>
</div>
      </main>
    </scale-box>
  <rightClickmenuList v-if="rightMenuObj&&showMenu" :rightMenuObj="rightMenuObj" @menuItemClick="menuItemClick"></rightClickmenuList>
  <el-dialog  custom-class="yaokongPersonDialog" :visible.sync="operatorPwdDialogVisible_0" width="22%" :close-on-click-modal="false">
    <p slot="title" class="el-dialog__title">操作人</p>
    <div class="operatorPwd">
      <div class="operator">
        <label>请输入操作人</label>
        <el-select size="small" v-model="operatorPwdObj.username" style="width: 16rem;">
          <el-option
            v-for="(item,index) in userInfoJson.operatorList"
            :key="index"
            :label="item.username"
            :value="item.username"
          ></el-option>
        </el-select>
      </div>
      <div class="pwd">
        <label>请输入密码</label>
        <el-input v-model="operatorPwdObj.pwd" size="small" type="password"   @keydown.enter.native="operatorPwdSubmit_0"></el-input>
      </div>
    </div>
    <span slot="footer" class="dialog-footer" >
				<el-button size="small" @click="operatorPwdSubmit_0">确 定</el-button>
				<el-button size="small" @click="operatorPwdDialogVisible_0 = false">取 消</el-button>
			</span>
  </el-dialog>
  <el-dialog  custom-class="yaokongPersonDialog" :visible.sync="operatorPwdDialogVisible" width="22%" :close-on-click-modal="false">
    <p slot="title" class="el-dialog__title">监护人</p>
    <div class="operatorPwd">
      <div class="operator">
        <label>请输入监护人</label>
        <el-select size="small" v-model="adminPwdObj.username" style="width: 16rem;">
          <el-option
            v-for="(item,index) in userInfoJson.adminList"
            :key="index"
            :label="item.username"
            :value="item.username"
          ></el-option>
        </el-select>

      </div>
      <div class="pwd">
        <label>请输入监护员密码</label>
        <el-input v-model="adminPwdObj.pwd" size="small" type="password" @keydown.enter.native="operatorPwdSubmit"></el-input>
      </div>
    </div>
    <span slot="footer" class="dialog-footer" >
				<el-button size="small" @click="operatorPwdSubmit">确 定</el-button>
				<el-button size="small" @click="operatorPwdDialogVisible = false">取 消</el-button>
			</span>
  </el-dialog>
  <el-dialog
    custom-class="switchPatrolDialog"
    :visible.sync="dialogVisible"
    :close-on-press-escape="true"
    :close-on-click-modal="true"
    :width="`40%`"
    :modal="false"
    @before-close="handleDialogClose"
  >

    <!-- 隔离刀 -->
    <template v-if="currentSelectMenuItemObj && currentSelectMenuItemObj.type == 'gelidao'">

      <!-- 遥控 - 弹框 -->
      <template v-if="currentSelectMenuItemObj.currentSelectItem.value == 1">
        <p slot="title" class="el-dialog__title">遥控</p>
        <yaokongDialog :currentSelectMenuItemObj="currentSelectMenuItemObj" :text="yaokongMsg"></yaokongDialog>
      </template>

      <!-- 开关清闪 - 弹框 -->
      <template v-if="currentSelectMenuItemObj.currentSelectItem.value == 2">
        <p slot="title" class="el-dialog__title">开关清闪</p>
      </template>



      <!-- 挂牌/摘牌 - 弹框 -->
      <template v-if="currentSelectMenuItemObj.currentSelectItem.value == 6">
        <p slot="title" class="el-dialog__title">挂牌/摘牌</p>
        <guapaiDialog :currentSelectMenuItemObj="currentSelectMenuItemObj"></guapaiDialog>
      </template>

      <span slot="footer" class="dialog-footer" >
					<el-button v-if="currentSelectMenuItemObj && currentSelectMenuItemObj.currentSelectItem.value != 4" size="small" @click="dialogVisible = false">取 消</el-button>

        <!-- 遥控 按钮 -->
					<el-button v-if="currentSelectMenuItemObj && currentSelectMenuItemObj.currentSelectItem.value == 1&&!canyaoKong" size="small" @click="yaokongSelect">遥控选择</el-button>
					<el-button v-if="currentSelectMenuItemObj && currentSelectMenuItemObj.currentSelectItem.value == 1&&canyaoKong" size="small" @click="remoteControlSelect">遥控执行</el-button>
					<el-button v-if="currentSelectMenuItemObj && currentSelectMenuItemObj.currentSelectItem.value == 1" size="small" type="primary" plain @click="dialogVisible = false">关 闭</el-button>
        <!-- 挂牌/摘牌 按钮 -->
					<el-button v-if="currentSelectMenuItemObj && currentSelectMenuItemObj.currentSelectItem.value == 6" size="small" type="primary" @click="handleBrand">确 定</el-button>

				</span>
    </template>

    <!-- 地刀 -->
    <template v-if="currentSelectMenuItemObj && currentSelectMenuItemObj.type == 'didao'">
      <!--          遥控-->
      <template v-if="currentSelectMenuItemObj.currentSelectItem.value == 1">
        <p slot="title" class="el-dialog__title">遥控</p>
        <yaokongDialog :currentSelectMenuItemObj="currentSelectMenuItemObj" :text="yaokongMsg"></yaokongDialog>
      </template>
      <!-- 开关清闪 - 弹框 -->
      <template v-if="currentSelectMenuItemObj.currentSelectItem.value == 0">
        <p slot="title" class="el-dialog__title">开关清闪</p>
        <span>暂无内容</span>
      </template>

      <!-- 全站清闪 - 弹框 -->
      <template v-if="currentSelectMenuItemObj.currentSelectItem.value == 4">
        <p slot="title" class="el-dialog__title">全站清闪</p>
        <span>暂无内容</span>
        <!-- <yaokongDialog :currentSelectMenuItemObj="currentSelectMenuItemObj"></yaokongDialog> -->
      </template>
      <!-- 挂牌/摘牌 - 弹框 -->
      <template v-if="currentSelectMenuItemObj.currentSelectItem.value == 5">
        <p slot="title" class="el-dialog__title">挂牌/摘牌</p>
        <guapaiDialog :currentSelectMenuItemObj="currentSelectMenuItemObj"></guapaiDialog>
      </template>
      <span slot="footer" class="dialog-footer" >
            <!-- 遥控 按钮 -->					<el-button v-if="currentSelectMenuItemObj && currentSelectMenuItemObj.currentSelectItem.value == 0" size="small" @click="dialogVisible = false">取 消</el-button>
					<el-button v-if="currentSelectMenuItemObj && currentSelectMenuItemObj.currentSelectItem.value == 1&&!canyaoKong" size="small" @click="yaokongSelect">遥控选择</el-button>
					<el-button v-if="currentSelectMenuItemObj && currentSelectMenuItemObj.currentSelectItem.value == 1&&canyaoKong" size="small" @click="remoteControlSelect">遥控执行</el-button>
					<el-button v-if="currentSelectMenuItemObj && currentSelectMenuItemObj.currentSelectItem.value == 1" size="small" type="primary" plain @click="dialogVisible = false">关 闭</el-button>


        <!-- 挂牌/摘牌 按钮 -->
					<el-button v-if="currentSelectMenuItemObj && currentSelectMenuItemObj.currentSelectItem.value == 5" size="small" type="primary" @click="handleBrand">确 定</el-button>
				</span>
    </template>

    <!-- 断路器 -->
    <template v-if="currentSelectMenuItemObj && currentSelectMenuItemObj.type == 'duanluqi'">
      <!-- 遥控 - 弹框 -->
      <template v-if="currentSelectMenuItemObj.currentSelectItem.value == 1">
        <p slot="title" class="el-dialog__title">遥控</p>
        <yaokongDialog :currentSelectMenuItemObj="currentSelectMenuItemObj" :text="yaokongMsg"></yaokongDialog>
      </template>
      <!-- 开关清闪 - 弹框 -->
      <template v-if="currentSelectMenuItemObj.currentSelectItem.value == 2">
        <p slot="title" class="el-dialog__title">开关清闪</p>
        <span>确定要将{{currentSelectMenuItemObj.currentObj.name}}开关清闪吗？</span>
        <!-- <yaokongDialog :currentSelectMenuItemObj="currentSelectMenuItemObj"></yaokongDialog> -->
      </template>
      <!-- 全站清闪 - 弹框 -->
      <template v-if="currentSelectMenuItemObj.currentSelectItem.value == 3">
        <p slot="title" class="el-dialog__title">全站清闪</p>
        <span>确定要将全部设备进行清闪吗？</span>
        <!-- <yaokongDialog :currentSelectMenuItemObj="currentSelectMenuItemObj"></yaokongDialog> -->
      </template>

      <!-- 挂牌/摘牌 - 弹框 -->
      <template v-if="currentSelectMenuItemObj.currentSelectItem.value == 6">
        <p slot="title" class="el-dialog__title">挂牌/摘牌</p>
        <guapaiDialog :currentSelectMenuItemObj="currentSelectMenuItemObj"></guapaiDialog>
      </template>
      <span slot="footer" class="dialog-footer" >
					<el-button v-if="currentSelectMenuItemObj && currentSelectMenuItemObj.currentSelectItem.value != 4" size="small" @click="dialogVisible = false">取 消</el-button>
					<el-button v-if="currentSelectMenuItemObj && currentSelectMenuItemObj.currentSelectItem.value == 2" size="small" @click="clearFlesh">确定</el-button>
					<el-button v-if="currentSelectMenuItemObj && currentSelectMenuItemObj.currentSelectItem.value == 3" size="small" @click="clearAll">确定</el-button>
        <!-- 遥控 按钮 -->
					<el-button v-if="currentSelectMenuItemObj && currentSelectMenuItemObj.currentSelectItem.value == 1&&!canyaoKong" size="small" @click="yaokongSelect">遥控选择</el-button>
					<el-button v-if="currentSelectMenuItemObj && currentSelectMenuItemObj.currentSelectItem.value == 1&&canyaoKong" size="small" @click="remoteControlSelect">遥控执行</el-button>
					<el-button v-if="currentSelectMenuItemObj && currentSelectMenuItemObj.currentSelectItem.value == 1" size="small" type="primary" plain @click="dialogVisible = false">关 闭</el-button>

        <!-- 挂牌/摘牌 按钮 -->
					<el-button v-if="currentSelectMenuItemObj && currentSelectMenuItemObj.currentSelectItem.value == 6" size="small" type="primary" @click="handleBrand">确 定</el-button>
				</span>
    </template>

    <!-- 把手 -->
    <template v-if="currentSelectMenuItemObj && currentSelectMenuItemObj.type == 'bashou'">
      <!-- 操作 - 弹框 -->
      <template v-if="currentSelectMenuItemObj.currentSelectItem.value == 1">
        <p slot="title" class="el-dialog__title">操作</p>
        <span>暂无内容</span>
      </template>
      <span slot="footer" class="dialog-footer" >
					<el-button v-if="currentSelectMenuItemObj && currentSelectMenuItemObj.currentSelectItem.value != 2" size="small" @click="dialogVisible = false">取 消</el-button>

				</span>
    </template>



    <template v-if="currentSelectMenuItemObj&&currentSelectMenuItemObj.type=='ruanyaban'">
      <template v-if="currentSelectMenuItemObj.currentSelectItem.value == 1">
        <p slot="title" class="el-dialog__title">遥控</p>
        <yaokongDialog :currentSelectMenuItemObj="currentSelectMenuItemObj" :text="yaokongMsg"></yaokongDialog>
      </template>
      <span slot="footer" class="dialog-footer" >
					<el-button v-if="currentSelectMenuItemObj && currentSelectMenuItemObj.currentSelectItem.value == 2" size="small" @click="dialogVisible = false">取 消</el-button>

        <!-- 遥控 按钮 -->
					<el-button v-if="currentSelectMenuItemObj && currentSelectMenuItemObj.currentSelectItem.value == 1&&!canyaoKong" size="small" @click="yaokongSelect">遥控选择</el-button>
					<el-button v-if="currentSelectMenuItemObj && currentSelectMenuItemObj.currentSelectItem.value == 1&&canyaoKong" size="small" @click="remoteControlSelect">遥控执行</el-button>
					<el-button v-if="currentSelectMenuItemObj && currentSelectMenuItemObj.currentSelectItem.value == 1" size="small" type="primary" plain @click="dialogVisible = false">关 闭</el-button>
				</span>
    </template>




  </el-dialog>
  <el-dialog ref="operateRecordDialogRef" custom-class="operateRecordDialog" :modal="false" :close-on-click-modal="false" v-if="operationRecordsDialogVisible" :visible.sync="operationRecordsDialogVisible" v-dialogDrag:{dialogDrag}="true" width="35%">
    <p slot="title" class="el-dialog__title">操作记录</p>
    <div class="messageAlarmList">
      <el-table :data="operationRecordsData" width="100%" height="250" >
        <el-table-column prop="num" label="序号" width="85" header-align="center" align="center" >
          <template #default="{row}">
            <span :class="{'is-highlight': !!row.isHighlight}">{{row.num}}</span>
          </template>
        </el-table-column>
        <el-table-column prop="createTime" label="操作时间" width="160" header-align="center" align="center" >
          <template #default="{row}">
            <span :class="{'is-highlight': !!row.isHighlight}">{{row.createTime}}</span>
          </template>
        </el-table-column>
        <el-table-column prop="log_desc" label="操作描述" header-align="center" >
          <template #default="{row}">
            <span :class="{'is-highlight': !!row.isHighlight}">{{row.log_desc}}</span>
          </template>
        </el-table-column>
      </el-table>
    </div>
  </el-dialog>
</div>
</template>

<style scoped lang="less">
@import "@/assets/css/public";
main {
  height: calc(100% - 90px);
  display: flex;
  color: #FFFFFF;
  border: 1px solid #fff;
  align-items: center;
  padding: 0 1rem;
  gap: 1rem;
  & > div {
    display: flex;
    flex-direction: column;
    justify-content: space-between;
    height: 98%;
    &:nth-of-type(1) {
  flex: 2.2;

      & > div {
        border: 3px solid white;
      }
    }
    &:nth-of-type(2) {
      flex: 1;

    }
    &:nth-of-type(3) {
      flex: 2.5;
    }

  }
}
.line-wrapper {
  height:59%;
  padding: 10px 0;
  box-sizing: border-box;
  svg {
    width: 100%;
    height: 100%;
  }
}
.num-wrapper{
  height: 40%;
  display: flex;
}
.remote-measurement-wrapper:nth-of-type(1){
   width: 55%;
}
.remote-measurement-wrapper:nth-of-type(2){
  width: 45%;
}
.control-handle-wrapper {
  border: 3px solid #fff;
  padding: 10px;
  box-sizing: border-box;
  position: relative;
  .control-handle-name {
    text-align: center;
    line-height: 30px;
    font-size: 20px;
    border-bottom: none;
    padding: 4px;
  }
  .control-handle-grid {
    width: 100%;
    display: grid;
    grid-template-rows: repeat(2, 1fr);
    grid-template-columns: repeat(2, 1fr);
    .control-handle-grid-item {
      border: 1px solid #cccccc;
      height: 100px;
      text-align: center;
      padding: 0px;
      box-sizing: border-box;
      position: relative;
      .svg-wrapper {
        width: 100%;
        height: 70px;
        svg {
          width: 100%;
          height: 100%;
          position: absolute;
          left: 0;
        }
        .rotate {
          transform-origin: center;
        }
        .polygon-icon {
          position: absolute;
          left: 10px;
          top: 36px;
          width: 50px;
          height: 50px;
        }
      }
      .grid-item-name {
        margin-top: 10px;
        font-size: 12px;
      }
    }
  }
}
.control-handle-wrapper:nth-of-type(1){
  height: 30%;
}
.control-handle-wrapper:nth-of-type(2){
  height: 69%;
  .control-handle-grid-item{
    height: 120px;
  }
}
.netState{
  border: 3px solid #fff;
  height: 16%;
  padding: 0 2rem;
}
.gzp-wrapper{
  border: 3px solid #fff;
  height: 82.5%;
}
.gzpInner{
  height: 93%;
  display: flex;
  justify-content: space-between;
  .gzpItem{
    width: 19%;
    display: flex;
    justify-content: space-between;
    flex-direction: column;
    height: 100%;
    border: 1px solid #fff;
    overflow-y: auto;
    .gzpTitle{
      font-size: 22px;
      color: #fff;
      text-align: center;
    }
  }
}
</style>
